package com.wsd.tank;

import java.awt.Graphics;

/**
 * 	子弹类
 * @author fengmoboy
 *
 */
public class Explode {
	private static final int SPEED = 15;
	
	public static int WIDTH = ResourceMgr.explodes[0].getWidth();
	
	public static int HEIGHT = ResourceMgr.explodes[0].getHeight();
	
	private int x;
	
	private int y;
	
	private int step = 0;
	
	private TankFrame tf;
	
	public Explode(int x, int y, TankFrame tf) {
		this.x = x;
		this.y = y;
		this.tf = tf;
		new Thread(()->new Audio("audio/explode.wav").play()).start();
	}


	// 绘制
	public void paint(Graphics g) {
		g.drawImage(ResourceMgr.explodes[step++], x, y, null);
		if(step >= ResourceMgr.explodes.length)
			tf.explodes.remove(this);
	}

}
